<?php
namespace app\admin\model;

use think\Model;
use app\common\util\DBUtil;

/**
 * 后台菜单模型
 * @package app\admin\model
 */
class Platform extends Model {
    protected $table = 'platform';

    // public $db = null;
    
    /**
    ** 查找所有的平台
    */
    public function get_all_platform(){
         $db = DBUtil::connect_admin();
         $platforms = $db->table('platform')->select();
         return $platforms;
    }

    /**
    * 查找本账号可以看到的平台
    */
    public function get_user_platform($platforms){
         $db = DBUtil::connect_admin();
         $list = $db->table('platform')->whereIn('platform', $platforms)->select();
         return $list;
    }

    public function update_platform($platform) {
        $db = DBUtil::connect_admin();
    }

}